package com.wksc.framework.impexp.bean;

import com.wksc.framework.impexp.constants.ImpErr;

import java.util.Map;

/**
 * <p> Title(文件名): ${file_name} </p>
 * <p> Description(描述): 导入任务逻辑处理后的返回结果</p>
 * <p> Copyright(版权): Copyright (c) ${year} </p>
 * <p> Company(公司): 成都四方信息技术有限公司 </p>
 * <p> CreateTime(生成日期)：11-11-13下午4:47 </p>
 *
 * @author wanglei
 * @version ${project_name}
 */
public class ImpReturn {
	/**
	 * 解析导入文件是否正确的标示 其具体值保存在Constants中 外部业务逻辑处理时不需要关注此属性
	 */
	private ImpErr resolveInfo;
	
	/**空白行数量*/
	private int blankLineNum = 0;

	/** 解析后正确的数据 */
	private Map<Integer, String[]> correctData;

	/** 错误数据信息,integer为该错误数据所在的行号, String为具体错误信息 */
	private Map<Integer, String> incorrectData;

	/** 业务操作的类型 0为 入库 1为发送配置变更 2为发命令 */
	private int businessType = -1;

	/** 操作结果 */
	private int sent;
	
	private boolean isSocket = false;

	/**
	 * 导入分批解析数据时使用的构造函数
	 * @param readData 解析到的正确数据
	 * @param incorrectInfo 不正确数据
	 * @param blankLineNum 空白行数量
	 */
	public ImpReturn(Map<Integer, String[]> readData,
			Map<Integer, String> incorrectInfo, int blankLineNum,boolean isSocket) {
		this.isSocket = isSocket;
		this.correctData = readData;
		this.incorrectData = incorrectInfo;
		this.blankLineNum = blankLineNum;
	}
	
	/**
	 * 导入分批解析数据时使用的构造函数
	 * @param readData 解析到的正确数据
	 * @param incorrectInfo 不正确数据
	 * @param blankLineNum 空白行数量
	 */
	public ImpReturn(Map<Integer, String[]> readData,
			Map<Integer, String> incorrectInfo, int blankLineNum) {
		this.correctData = readData;
		this.incorrectData = incorrectInfo;
		this.blankLineNum = blankLineNum;
	}

	public ImpReturn(Map<Integer, String> incorrectData, int businessType,
			int sent,boolean isSocket) {
		super();
		this.incorrectData = incorrectData;
		this.businessType = businessType;
		this.sent = sent;
		this.isSocket = isSocket;
	}
	
	public ImpReturn(Map<Integer, String> incorrectData, int businessType,
			int sent) {
		super();
		this.incorrectData = incorrectData;
		this.businessType = businessType;
		this.sent = sent;
	}

	/* =========setters & getters============== */
	public Map<Integer, String> getIncorrectData() {
		return incorrectData;
	}

	public void setIncorrectData(Map<Integer, String> incorrectData) {
		this.incorrectData = incorrectData;
	}

	public int getBusinessType() {
		return businessType;
	}

	public void setBusinessType(int businessType) {
		this.businessType = businessType;
	}

	public ImpErr getResolveInfo() {
		return resolveInfo;
	}

	public void setResolveInfo(ImpErr resolveInfo) {
		this.resolveInfo = resolveInfo;
	}

	public Map<Integer, String[]> getCorrectData() {
		return correctData;
	}

	public void setCorrectData(Map<Integer, String[]> correctData) {
		this.correctData = correctData;
	}

	public int getSent() {
		return sent;
	}

	public void setSent(int sent) {
		this.sent = sent;
	}

	public int getBlankLineNum() {
		return blankLineNum;
	}

	public void setBlankLineNum(int blankLineNum) {
		this.blankLineNum = blankLineNum;
	}

	public boolean isSocket() {
		return isSocket;
	}

	public void setSocket(boolean isSocket) {
		this.isSocket = isSocket;
	}
	
	
	/* =========setters & getters============== */
}
